<?xml version="1.0" encoding="UTF-8"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                template="/templates/masterLayout.xhtml">

    <ui:define name="title">
        <h:outputText value="Login Page"/>
    </ui:define>

    <ui:define name="content">
        <f:view beforePhase="#{loginBean.beforePhaseListener(e)}">
            <h:form prependId="false" style="margin-left: auto; margin-right: auto;">
                <h2><h:outputText value="Please enter your email and password"/></h2>
                <p:messages autoUpdate="true" closable="true" />
                <h:panelGrid columns="3">
                    <h:outputLabel value="Email"/>
                    <p:inputText value="#{loginBean.email}" label="email" required="true" id="j_username"
                                 requiredMessage="Email is required"/>
                    <p:message for="j_username"/>

                    <h:outputLabel value="Password"/>
                    <p:inputText value="#{loginBean.password}" label="password" required="true" id="j_password"
                                 requiredMessage="Password is required"/>
                    <p:message for="j_password"/>

                    <!--h:outputLabel for="remember_me" value="Remember me" class="inline" />
                    <p:selectBooleanCheckbox id="remember_me" name="_spring_security_remember_me" /-->

                    <f:facet name="footer">
                        <p:commandButton id="loginButton" value="Sign in" ajax="false"
                                         action="#{loginBean.loginAction()}"/>
                    </f:facet>
                </h:panelGrid>
            </h:form>
        </f:view>

    </ui:define>
</ui:composition>